package com.dbdata.move.model;

// Generated cafuc by Hibernate Tools 4

import java.util.HashSet;
import java.util.Set;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * StudentClass generated by hbm2java
 */
@Entity
@Table(name = "student_class")
public class StudentClass implements java.io.Serializable {

	private Long id;
	private StudentClass studentClass;
	private String className;
	private int state;
	private Set<Student> students = new HashSet<Student>(0);
	private Set<StudentClass> studentClasses = new HashSet<StudentClass>(0);

	public StudentClass() {
	}

	public StudentClass(int state) {
		this.state = state;
	}

	public StudentClass(StudentClass studentClass, String className, int state,
			Set<Student> students, Set<StudentClass> studentClasses) {
		this.studentClass = studentClass;
		this.className = className;
		this.state = state;
		this.students = students;
		this.studentClasses = studentClasses;
	}

	@Id
	@GeneratedValue(strategy = IDENTITY)
	@Column(name = "ID", unique = true, nullable = false)
	public Long getId() {
		return this.id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "CLASS_CLASS")
	public StudentClass getStudentClass() {
		return this.studentClass;
	}

	public void setStudentClass(StudentClass studentClass) {
		this.studentClass = studentClass;
	}

	@Column(name = "CLASS_NAME", length = 30)
	public String getClassName() {
		return this.className;
	}

	public void setClassName(String className) {
		this.className = className;
	}

	@Column(name = "STATE", nullable = false)
	public int getState() {
		return this.state;
	}

	public void setState(int state) {
		this.state = state;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "studentClass")
	public Set<Student> getStudents() {
		return this.students;
	}

	public void setStudents(Set<Student> students) {
		this.students = students;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "studentClass")
	public Set<StudentClass> getStudentClasses() {
		return this.studentClasses;
	}

	public void setStudentClasses(Set<StudentClass> studentClasses) {
		this.studentClasses = studentClasses;
	}

}
